spring:
  datasource:
    url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:tinkoff2_hw4}
    driverClassName: org.postgresql.Driver
    username: ${DB_USER:postgres}
    password: ${DB_PASSWORD:admin}
  jpa:
    hibernate:
      ddl-auto: update
    properties:
      hibernate:
        order_by.default_null_ordering: last
        format_sql: true
    open-in-view: false
    generate-ddl: true

management:
  endpoint:
    health:
      probes:
        enabled: true
  health:
    readinessstate:
      enabled: true
    livenessstate:
      enabled: true

notifications:
  url: ${NOTIFICATION_SERVICE_URL:http://notifications:8080}

redis:
  host: ${REDIS_HOST:localhost}
  port: ${REDIS_PORT:6379}
  idempotency:
    ttl: 30

kafka:
  topic:
    fee: ${KAFKA_TOPIC:fees}
  bootstrap:
    servers: ${KAFKA_BOOTSTRAP_SERVERS:kafka:9092}

grpc:
  client:
    grpcConverterClientService:
      address: ${CONVERTER_URL:http://converter:9090}
      enableKeepAlive: true
      keepAliveWithoutCalls: true
      negotiation-type: plaintext

resilience4j:
  circuitbreaker:
    instances:
      CircuitBreakerService:
        sliding-window-size: 10
        sliding-window-type: COUNT_BASED
        permitted-number-of-calls-in-half-open-state: 3
        wait-duration-in-open-state: 10s
        minimum-number-of-calls: 10
        failure-rate-threshold: 50
        automatic-transition-from-open-to-half-open-enabled: true